package com.txw.javaCore.model.mapper;

import com.txw.javaCore.model.dto.PraiseRankDto;
import com.txw.javaCore.model.entity.Praise;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface PraiseMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Praise record);

    int insertSelective(Praise record);

    Praise selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Praise record);

    int updateByPrimaryKey(Praise record);

    //根据博客id和用户id查询点赞记录
    Praise seletctByBlogUserId(@Param("blogId") Integer blogId,@Param("uId") Integer uId);

    //根据博客id查询总点赞数
    int countByBlogId(@Param("blogId") Integer blogId);

    //取消点赞博客
    int cancelPraiseBlog(@Param("blogId") Integer blogId,@Param("uId") Integer uId);

    //获取博客点赞总数排行榜
    List<PraiseRankDto> getPraiseRank();

}